/* vi:set ts=8 sts=4 sw=4:
 *
 * VIM - Vi IMproved	by Bram Moolenaar
 * 			CodeCheck extension by Birgi Tamersoy
 *				birgitamersoy@gmail.com
 *
 * Do ":help uganda"  in Vim to read copying and usage conditions.
 * Do ":help credits" in Vim to see a list of people who contributed.
 * See README.txt for an overview of the Vim source code.
 */

/*
 * ipc.h: tools for inter-process comms
 */


#ifndef VIM_IPC_H_INCLUDED
#define VIM_IPC_H_INCLUDED

typedef void* semaphore_handle_T;

enum {
    SEMAPHORE_OK,
    SEMAPHORE_PERMISSION_ERROR,
    SEMAPHORE_KEY_ERROR,
    SEMAPHORE_EXISTS,
    SEMAPHORE_NOT_FOUND,
    SEMAPHORE_MEMORY_ERROR,
    SEMAPHORE_LIMIT_ERROR,
    SEMAPHORE_VALUE_ERROR,
    SEMAPHORE_UNKNOWN
} semaphore_status_T;

semaphore_status_T create_semaphore( semaphore_handle_T handle, char* key, int initial_value ); 
semaphore_status_T aquire_semaphore( semaphore_handle_T handle );
semaphore_status_T release_semaphore( semaphore_handle_T handle );
semaphore_status_T destroy_semaphore( semaphore_handle_T handle );

#endif
